import Vue from 'vue'
import App from './App'
import store from './store'
import { utilities, file } from '@/utils/common.js'
import * as filters from './filters' // global filters 全局过滤
Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.config.productionTip = false

App.mpType = 'app'

const app = new Vue({
    ...App,
	store
})
app.$mount()

/**
 * 返回图片
 * @param {Object} picture
 */
Vue.prototype.$getImg = function(picture) {
	if(!picture) return '/static/zwtp.png'
	return file.getImage(picture)
}

/**
 * 返回头像
 * @param {Object} picture
 */
Vue.prototype.$getHead = function(picture) {
	if(!picture) return '/static/head.jpg'
	return file.getImage(picture)
}

/**
 * 展示图片 或 下载文件
 * @param {Object} fileId
 */
Vue.prototype.$showOrDownLoad = function(fileId, attachment) {
	file.showOrDownload(fileId, attachment)
}
